package com.cskaoyan.demo7.controller;

import com.cskaoyan.demo7.bean.req.GoodsCreateVo;
import com.cskaoyan.demo7.bean.resp.BaseRespVo;
import com.cskaoyan.demo7.bean.resp.GoodsDetailVo;
import com.cskaoyan.demo7.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description：
 * @Author：BLUEBLANK
 * @Date：2024/4/22 19:40
 */

@RestController
@RequestMapping("/wx/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;
    @PostMapping("create")
    public BaseRespVo create(@RequestBody GoodsCreateVo goodsCreateVo){
        goodsService.create(goodsCreateVo);
        return BaseRespVo.ok(null);
    }

    @GetMapping("detail")
    public BaseRespVo detail(Integer id){
        GoodsDetailVo goodsDetailVo = goodsService.detail(id);
        return BaseRespVo.ok(goodsDetailVo);
    }
}
